/**
 *Echart 工具类 
 */

function setEchartOption(chart,title,subTitle,legend,xAxis,series){
	option = {
			  title : {
			        text: title,
			        subtext: subTitle
			    },
		    tooltip : {
		        trigger: 'axis'
		    },
		    legend: {
		        data:legend
		    },
		    toolbox: {
		        show : true,
		        feature : {
		            mark : {show: true},
		            dataView : {show: true, readOnly: false},
		            magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
		            restore : {show: true},
		            saveAsImage : {show: true}
		        }
		    },
		    calculable : true,
		    xAxis : [
		        {
		            type : 'category',
		            boundaryGap : false,
		            data : xAxis
		        }
		    ],
		    yAxis : [
		        {
		            type : 'value'
		        }
		    ],
		    series : series
		};
	chart.setOption(option);
		                    
}